package com.jadefashion.mapper;

import com.jadefashion.pojo.Order;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderMapper {
    int isOrderedByMemberIdAndOrderdateAndSetmealId(@Param("mid") Integer mid, @Param("orderDate") String orderDate, @Param("setmealId") String setmealId);

    void addOrder(Order order);

    Map<String,String> findOrderInfo(@Param("orderId") String orderId);

    int findOrderCountByDate(@Param("startDate") String startDate, @Param("endDate") String endDate);

    int findOrderFinishCount(@Param("startDate") String startDate, @Param("endDate") String endDate);

    List<Map> findHotSetmeal();

    int totalOrder();

    void addOrderInfo(@Param("orderNumber") String orderNumber,@Param("payDate") Date payDate, @Param("setMeal_Name")String name,@Param("setMeal_Price") Float price, @Param("business_Name") String business_Name, @Param("member_Id") Integer id,@Param("orderStatus") int orderStatus);


    Integer findOrderStatus(@Param("orderNumber")String orderNumber);

    void updateOrderStauts(@Param("out_trade_no") String out_trade_no);

    void cleanUnpayedOrderByID(@Param("id") String id);

    List<Map> findUnPayedOrders();

    String findOrderDateBySetmealNameAndMemberId(@Param("setMealName") String setMealName, @Param("member_id") String member_id);
}
